﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Details.Master" CodeBehind="details.aspx.vb" Inherits="AssignmentProject.receipedetail" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
        .style1
        {
            text-align: center;
        }
    </style>
    <link href="Styles/jquery.ratings.css" rel="stylesheet" type="text/css" />
      <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js"></script>
      <script type="text/javascript" src="Scripts/jquery.ratings.js"></script>
	<script type="text/javascript" src="Scripts/example.js"></script>
    
    <script type="text/javascript">
        $(document).ready(function () {
            $("#HideShowBTN").toggle(
       function () {
           $("#commentsPane").slideDown(300);

       },
       function () {
           $("#commentsPane").fadeOut(600);

       }
       );
        });
    </script>
    <style type="text/css">
    #container
    {
        position:absolute;
        left:42%;
    }
    #commentsPane { display:none;}
       
    .commentsContent {width: 400px;margin:0 auto;}
    </style>
     

    </asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cpMainContent" runat="server">

    <br />

    <p>
        <asp:Button ID="BTN_like" runat="server" Text="Like This!" />
    </p>
    <div>
     <div>
        <h5>
        <asp:Label ID="Recipe_LBL" runat="server"/>
        </h5>
      <div class="clearFloats">
    <img alt="recipe selection" class="detailedImage" src="<%=GetImagePath() %>"/> 
    </div>  
          <div>  
          <p>
          </p>
          
              <div>
        <div class="floatright"><asp:Label ID="MealType_LBL" runat="server" CssClass="floatleft" /></div>
         <asp:Label ID="PrepTime_LBL" runat="server" CssClass="floatleft" /></div></div>
    
          <p>
          </p>
          <div class="clearFloats">
          <asp:Label ID="Description_LBL" runat="server" Width="400px" />
         </div>
          <div>
          <p>
              <asp:Label ID="Instructions_LBL" runat="server" Text="Label" Width="400px"></asp:Label>
          </p>
          </div>
        
          <asp:SqlDataSource 
           ID="RecipeData" runat="server" 
            ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
            ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" 
            DatasourceMode="DataReader"
            SelectCommand="SELECT [MealType], [RecipeName], [Picture], [Description], [Preparation_Time], [Instructions], [Submitted_by] FROM [recipes] WHERE ([ID] = ?)"
            OnSelecting="RecipeData_Selecting">
            
            <SelectParameters>
                <asp:QueryStringParameter Name="ID" Type="Int32"/>
            </SelectParameters>
        </asp:SqlDataSource>

        </div>
  
    </div>
      <p>
          <asp:Label ID="LabelLike" runat="server" Text="You Like This" Font-Bold="True" 
              Font-Size="Medium" Font-Underline="True"></asp:Label>
    </p>
        <br />
    <p>
        <asp:Button ID="HideShowBTN" runat="server" Text="Show/Hide Comments" clientidmode="Static"/>
        &nbsp;</p>
    <div class="commentsContent" id="commentsPane" clientidmode="Static">
    <p>
      
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
            ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" 
            
            SelectCommand="SELECT [Author], [Comment], [Title], [ID], [Recipe_fkid] FROM [Comments] WHERE ([Recipe_fkid] = ?)">
            <SelectParameters>
                <asp:QueryStringParameter Name="Recipe_fkid" QueryStringField="ID" 
                    Type="Int32" DefaultValue="{0}" />
            </SelectParameters>
        </asp:SqlDataSource>
    </p>
    <p>
      
        &nbsp;</p>
    <p>
      
        <asp:Label ID="Label1" runat="server" Text="Comments"></asp:Label>
    </p>
    <asp:ListView ID="ListView1" runat="server" DataSourceID="SqlDataSource1">
        <AlternatingItemTemplate>
            <span style="background-color: #FFF8DC;">
            &nbsp;
            <h2><asp:Label ID="TitleLabel" runat="server" Text='<%# Eval("Title") %>' /></h2>
            <br />
            &nbsp;<asp:Label ID="CommentLabel" runat="server" Text='<%# Eval("Comment") %>' />
            <br />
            &nbsp;
            <asp:Label ID="AuthorLabel" 
                runat="server" Text='<%# Eval("Author") %>' />
            <br />
<br /><hr /></span>
        </AlternatingItemTemplate>
        <EditItemTemplate>
            <span style="background-color: #008A8C;color: #FFFFFF;">Author:
            <asp:TextBox ID="AuthorTextBox" runat="server" Text='<%# Bind("Author") %>' />
            <br />
            Comment:
            <asp:TextBox ID="CommentTextBox" runat="server" Text='<%# Bind("Comment") %>' />
            <br />
            Title:
            <asp:TextBox ID="TitleTextBox" runat="server" Text='<%# Bind("Title") %>' />
            <br />
            <asp:Button ID="UpdateButton" runat="server" CommandName="Update" 
                Text="Update" />
            <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" 
                Text="Cancel" />
            <br /><br /></span>
        </EditItemTemplate>
        <EmptyDataTemplate>
            <span>Be the first to comment on this recipe!</span>
        </EmptyDataTemplate>
        <InsertItemTemplate>
            <span style="">Author:
            <asp:TextBox ID="AuthorTextBox" runat="server" Text='<%# Bind("Author") %>' />
            <br />Comment:
            <asp:TextBox ID="CommentTextBox" runat="server" Text='<%# Bind("Comment") %>' />
            <br />Title:
            <asp:TextBox ID="TitleTextBox" runat="server" Text='<%# Bind("Title") %>' />
            <br />
            <asp:Button ID="InsertButton" runat="server" CommandName="Insert" 
                Text="Insert" />
            <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" 
                Text="Clear" />
            <br /><br /></span>
        </InsertItemTemplate>
        <ItemTemplate>
            <span style="background-color: #DCDCDC; color: #000000;">&nbsp;
            <h2><asp:Label ID="TitleLabel" runat="server" Text='<%# Eval("Title") %>' /></h2>
            <br />
            &nbsp;
            <asp:Label ID="CommentLabel" runat="server" Text='<%# Eval("Comment") %>' />
            <br /> &nbsp;
            <asp:Label 
                ID="AuthorLabel" runat="server" Text='<%# Eval("Author") %>' />
            <br />
            
           
<br /><hr /></span>
        </ItemTemplate>
        <LayoutTemplate>
            <div ID="itemPlaceholderContainer" runat="server" 
                style="font-family: Verdana, Arial, Helvetica, sans-serif;">
                <span runat="server" id="itemPlaceholder" />
            </div>
            <div style="text-align: center;background-color: #CCCCCC;font-family: Verdana, Arial, Helvetica, sans-serif;color: #000000;">
            </div>
        </LayoutTemplate>
        <SelectedItemTemplate>
            <span style="background-color: #008A8C;font-weight: bold;color: #FFFFFF;">
            Title:
            <h2><asp:Label ID="TitleLabel" runat="server" Text='<%# Eval("Title") %>' /></h2>
            <br />
            Comment:
            <asp:Label ID="CommentLabel" runat="server" Text='<%# Eval("Comment") %>' />
            <br />
             Author:
            <asp:Label ID="AuthorLabel" runat="server" Text='<%# Eval("Author") %>' />
            <br />
<br /><hr /></span>
        </SelectedItemTemplate>
    </asp:ListView>
    </div>
    <p class="style1">
        Add Comment Here</p>
    <p class="style1">
        &nbsp;</p>
    <p class="style1">
        Comment Title</p>
    <p class="style1">
        <asp:TextBox ID="TB_Title" runat="server" Height="28px"></asp:TextBox>
    </p>
    <p class="style1">
        Comment</p>
    <p class="style1">
        <asp:TextBox ID="TB_Comment" runat="server" Height="89px" TextMode="MultiLine" 
            Width="222px"></asp:TextBox>
    </p>
    <p>
        &nbsp;</p>
    <p class="style1">
        Rate!</p>
    

    <div id="container">
     <div id="example-2"></div> <br />
    Your Rating: <span id="example-rating-2">not set</span></div>
    <p>
        
    </p>

     
       
        
        &nbsp;

        <input id="ratingvalue" name="ratingvalue" value="this should be in the label" type="hidden" runat="server" clientidmode="Static" />
    <p>
        &nbsp;</p>
    <p>
        <asp:SqlDataSource ID="TagsDataSource" runat="server" 
            ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
            ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" 
            SelectCommand="SELECT [ID], [Tag] FROM [Tags]"></asp:SqlDataSource>
    </p>
    <p class="style1">
        &nbsp;</p>
    <p class="style1">
        &nbsp;</p>
    <p class="style1">
        <asp:Button ID="BTN_AddComment" runat="server" Text="Add Your Comment" />
    </p>
    <p>
        &nbsp;</p>
    <p class="style1">
        <asp:Button ID="Button1" runat="server" Text="Tag this Recipe!" />
    </p>
   
    <div class="style1">
    <asp:CheckBoxList ID="CheckBoxList1" runat="server" 
        DataSourceID="TagsDataSource" DataTextField="Tag" DataValueField="ID" 
        Height="18px" RepeatDirection="Horizontal" CssClass="centreAlign">
    </asp:CheckBoxList>
    </div>
    
    <p class="style1">
        Add your Own Tags (please separate each with a comma)</p>
    <p class="style1">
        <asp:TextBox ID="TagBox" runat="server"></asp:TextBox>
    </p>
    <p>
        &nbsp;</p>
        
       
</asp:Content>
